Skip to content

Document excerpt for Razor, and fix Find All Refs#81291

Merged
davidwengier merged 8 commits intodotnet:mainfrom
davidwengier:RazorFindRefs
Nov 18, 2025
Merged

Document excerpt for Razor, and fix Find All Refs#81291
davidwengier merged 8 commits intodotnet:mainfrom
davidwengier:RazorFindRefs

Conversation

@davidwengier
Copy link
Member

Part of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2633418

We had to revert some code that made FAR, Hover, Go To Def etc. work in Razor files because to support it we had to add #line mappings for things, and that broke Hot Reload by changing PDB offsets. Who knrew!

This PR enables us to bring back that support without #line directives by allowing locations in Razor source genned documents to be found by FAR even if they're hidden. It also tweaks the LSP source mapping code to drop results that can't be mapped, which actually matches was the VS side already did anyway. Finally it exposes a hook for Razor to implement a document excerpt service, which is something I punted previously because the results with the #line directives were good enough, but now they're really not.

Commit-at-a-time review is probably simpler, to make it clear which change is for which purpose.


namespace Microsoft.CodeAnalysis.Classification;

[DataContract]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is public API, so let me know if this change isn't allowed, and I can create a wrapper in the EA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants